package monitor;

/**
 * Interface definition: Monitor.
 * 
 * @author OpenORB Compiler
 */
public abstract class MonitorPOA extends org.omg.PortableServer.Servant
        implements MonitorOperations, org.omg.CORBA.portable.InvokeHandler
{
    public Monitor _this()
    {
        return MonitorHelper.narrow(_this_object());
    }

    public Monitor _this(org.omg.CORBA.ORB orb)
    {
        return MonitorHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:monitor/Monitor:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("ergebnis")) {
                return _invoke_ergebnis(_is, handler);
        } else if (opName.equals("rechnen")) {
                return _invoke_rechnen(_is, handler);
        } else if (opName.equals("ring")) {
                return _invoke_ring(_is, handler);
        } else if (opName.equals("startzahlen")) {
                return _invoke_startzahlen(_is, handler);
        } else if (opName.equals("terminieren")) {
                return _invoke_terminieren(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_ring(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String[] arg0_in = monitor.ProzessIdsHelper.read(_is);

        ring(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_startzahlen(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        int[] arg0_in = monitor.StartzahlenHelper.read(_is);

        startzahlen(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_rechnen(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        String arg1_in = _is.read_string();
        int arg2_in = _is.read_long();

        rechnen(arg0_in, arg1_in, arg2_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_terminieren(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        String arg1_in = _is.read_string();
        boolean arg2_in = _is.read_boolean();

        terminieren(arg0_in, arg1_in, arg2_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_ergebnis(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        int arg1_in = _is.read_long();

        ergebnis(arg0_in, arg1_in);

        _output = handler.createReply();

        return _output;
    }

}
